myfun1 <- function(n,s,p) {
	
	choose(n,p)*choose(2*s+p-1,2*s)/choose(n+2*s-1,2*s)
	
	
}

myfun2 <-function(n,a) {
	sum = 0
	for (i in 1:a) {
		
		sum = sum+choose(n,a)
		
	}

	sum 
}

myfun3 <- function(balls,bins) {
	
	choose(balls,bins)*factorial(bins)*(bins)^(balls-bins)
	
	
}

stirling <- function(n,k) {
	
	sum = 0 
	for (j in 1:k) {
		
		sum = sum + (-1)^(k-j)*choose(k,j)*j^n
		
	}
	sum 
	
}